<%@ page import="java.util.List" %>
<%@ page import="com.bean.Notice" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>公告界面</title>
    <link rel="stylesheet" href="../css/base.css">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        body {
            background-color: #edeffc;
        }
        .main {
            background-color: #fff;
            width: 1000px;
            text-align: center;
            margin: 10px auto;
            padding: 10px;
        }
        .notice {
            margin: 0 auto;
            text-align: center;
            color: #000;
        }
        .notice h2 {
            font-size: 30px;
            font-weight: 400;
        }
        .notice_content {
            font-size: 16px;
            text-align: left;
            margin: 20px auto;
            background-color: #fff;
            text-indent: 2em;
            color: #000;
        }
    </style>
</head>
<body>
<%
    String id = request.getParameter("id");
    System.out.println("id="+id);
    List<Notice> notices = (List<Notice>) request.getSession().getAttribute("notices");
    Notice notice = null;
    for (int i=0;i<notices.size();i++) {
        System.out.println(notices.get(i).getId());
        if (notices.get(i).getId().equals(id)) {
            notice = notices.get(i);
            break;
        }
    }
%>
<div class="main">
    <div class="notice">
        <h2><%=notice.getTitle()%></h2>
        <p><%=notice.getTime()%></p>
    </div>
    <div class="notice_content">
        <p><%=notice.getContent()%></p>
    </div>
</div>
</body>
</html>
